package com.mars.foodserver.service;

import com.mars.foodserver.entity.FoodLike;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mars.foodserver.response.FoodLikeResponse;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author wq
 * @since 2021-07-21
 */
public interface IFoodLikeService extends IService<FoodLike> {

    /**
     * 点赞
     *
     * @param userId 用户ID
     * @param foodId 美食ID
     * @param type   1 点赞 2 取消点赞
     */
    void like(Integer userId, Integer foodId, Integer type);

    /**
     * 是否点赞美食
     *
     * @param userId 用户ID
     * @param id     ID
     * @return boolean
     */
    boolean isLikeFood(Integer userId, Integer id);


    /**
     * 点赞列表
     *
     * @param userId 用户ID
     * @return List<FoodLikeResponse>
     */
    List<FoodLikeResponse> foodLikes(Integer userId);
}
